import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'
import storage from 'store'
import { baseURL } from '@/util/index'
import authorizationApi from './modules/authorization'
import resourceApi from './modules/resource'
import roleApi from './modules/role'
import adminApi from './modules/admin'

Vue.use(VueAxios, axios)

axios.interceptors.request.use(function (config) {
	config.baseURL = baseURL
	let token = storage.get('token')
	if (token) {
		config.headers['token'] = token;
	}
	return config;
})

export {
	authorizationApi,
	resourceApi,
	roleApi,
	adminApi,
}



